<?php
    // Gets the names of the tables of the database.
    // Parameters : db[object(PDO)]
    // Return : array[string]
    function getDbTablesNames($db)
    {
        // Creating the query and the array of results.
        $query =
        'SHOW TABLES FROM m2l';
        $tablesNames = array();
        
        // Executing the query.
        $queryResults = $db->query($query);
        
        // Storing the results into an array.
        foreach ($queryResults as $resultLine)
        {
            $tablesNames[] = $resultLine[0];
        }
        
        // Returning the array.
        return $tablesNames;
    }
?>
